package com.jmu.boot.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jmu.boot.entity.User;
import com.jmu.boot.mapper.UserMapper;
import com.jmu.boot.service.UserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author DJ同学
 * @since 2021-01-14
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Autowired
    private UserMapper userMapper;
    //目前页 页数
    @Override
    public List<User> getLimit(int cur, int size) {
        Page<User> page = new Page<>(cur,size);
        userMapper.selectPage(page,null);
//        page.getRecords().forEach(System.out::println);
        return page.getRecords();
    }
}
